package cn.uce.cc.rest.control;

import cn.uce.base.entity.CcSmsRecord;
import cn.uce.cc.api.service.biz.ICcSmsMessageBiz;
import cn.uce.cc.api.service.biz.ICcosRoutTrackBiz;
import cn.uce.common.constants.CcConstants;
import cn.uce.common.omg.biz.IOmgOrgBiz;
import cn.uce.web.common.base.BaseController;
import cn.uce.web.common.base.CurrentUser;
import cn.uce.web.common.util.WebUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Map;

 /**
   * 提供给云呼项目组进行调用
   * @Author liupan
   * @Description
   * @Date  2020-07-16 10:24
   */
@Controller
@RequestMapping(value = "users/yunhu")
public class YunHuController extends BaseController {

    private Logger log = LoggerFactory.getLogger(YunHuController.class);

    @Resource
    private ICcSmsMessageBiz ccSmsMessageBiz;

//    @Resource
//    private ICcosRoutTrackBiz ccosRoutTrackBiz;

     /**
      * 云呼平台发送短信
      * @param sendPhone 手机号码
      * @param sendType 1 代收货款  2 货物路由  3 下单
      * @param wayNum 运单号
      * @return
      */
    @RequestMapping("/sendPhoneMessage")
    @ResponseBody
    public Map<String, Object> sendPhoneMessage(String sendPhone, String sendType,String wayNum){
        try {
        returnSuccess (ccSmsMessageBiz.sendMessageByYunhu(sendPhone,sendType,wayNum));
        } catch (Exception e) {
            log.error("CsSmsMessageController,sendPhoneMessage,Exception",e);
            returnError("发送短信失败");
        }
        return returnSuccess();
    }


//    /**
//     * @MethodName getrouttrak
//     * @return routtrak
//     */
//    @RequestMapping(value = "/getRoutingLocusInfoByWBNo", method = RequestMethod.POST)
//    @ResponseBody
//    public Map<String, Object> getRoutingLocusInfoByWBNo(String wayNum){
//        try {
//            return returnSuccess(ccosRoutTrackBiz.getRoutingLocusInfoByWBNo(wayNum));
//        } catch (Exception e) {
//            logger.error("路由时效产品类型初始化失败：" +e);
//        }
//        return null;
//    }

}
